package 中介者模式;

public class main {

    public static void main(String[] args) {
        //定义房客同事类
        Colleague colleagueTenant = new ColleagueTenant();
        //定义房东同事类
        Colleague colleagueLandlord = new ColleagueLandlord();
        //创建一个具体的中间者
        ConcreteMediator concreteMediator = new ConcreteMediator(colleagueTenant,colleagueLandlord);
        boolean resoult = concreteMediator.notifyColleagueTenant("想租2室1厅的吗!");
        if (resoult) {
            concreteMediator.notifyColleagueLandlord("租客满意");
        }else {
            concreteMediator.notifyColleagueLandlord("租客不满意");
        }

    }
}
